cmake_minimum_required(VERSION 3.19)
project(TranslationAgent LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

find_package(Qt6 REQUIRED COMPONENTS
    Core
    Widgets
    Gui
    WebEngineWidgets
)
find_package(Qt6 REQUIRED COMPONENTS Widgets)


add_subdirectory(QHotkey-master)

qt_add_executable(TranslationAgent
    WIN32 MACOSX_BUNDLE
    main.cpp
    translatoragentwindow.cpp
    translatoragentwindow.h
    loadinganimation.h
    loadinganimation.cpp
    res.qrc
    screenshotoverlay.h screenshotoverlay.cpp
)

target_link_libraries(TranslationAgent PRIVATE
    Qt::Core
    Qt::Widgets
    Qt::Gui
    Qt6::WebEngineWidgets
    qhotkey
)
target_link_libraries(TranslationAgent PRIVATE Qt6::Widgets)

target_include_directories(TranslationAgent PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/QHotkey-master
)

include(GNUInstallDirs)
install(TARGETS TranslationAgent
    BUNDLE  DESTINATION .
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
